﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DB_Connection
{
    abstract class DatabaseConnection
    {
       private string connectionString;
       public string ConnectionString
        {
            get
            {

                return connectionString;
            }
            set
            {
              
                if (String.IsNullOrWhiteSpace(value))
                    throw new ArgumentNullException("Connection string cannot be empty");
                else
                    connectionString = value;
            }
        }

       public TimeSpan Timeout { get; private set; }

        public DatabaseConnection(string connectionString, TimeSpan timeout)
        {
            ConnectionString = connectionString;
            Timeout = timeout;

        }
        public abstract void OpenConnection();

        public abstract void CloseConnection();
    }
}
